﻿@model ToyStore.Web.Mvc.Controllers.ViewModels.ProductListViewModel
@using PagedList.Mvc;
@using PagedList; 
@using ToyStore.Domain.Store;
@{
    ViewBag.Title = "Twoja półka";
    Layout = "~/Views/Shared/_Layout.cshtml";
}


<script type="text/javascript" language="javascript">
	$().ready(function () {
		$('.PagedList-skipToPrevious a').text("Poprzednia");
		$('.PagedList-skipToNext a').text("Następna");
		$(".rotate_ico").click(function () { //rotate
			$(this).closest('.flipbox').flip({
				direction: 'lr',
				content: function() {
					var visiblePage = $(this).find('.side_active');
					var invisiblePage = visiblePage.siblings();
					visiblePage.toggleClass("side_active").hide();
					invisiblePage.toggleClass("side_active").show();
					$(this).find(".ribbon").toggle();
				}
			});
		});
	});

</script>

@if (Model.ProductsList.TotalItemCount > Model.ItemsOnPage)
{
   @:<div style="clear:both">
   @:<div class="pull-left">@(Html.PagedListPager(Model.ProductsList, x => Url.Action("YourShelf", "Product", new { categoryId = Model.CategoryId, pageNumber = x, itemsOnPage = Model.ItemsOnPage })))</div>
}

<div style="clear:both">
@foreach (Product p in (System.Collections.IEnumerable)Model.ProductsList)
{
  @Html.Partial("_ProductListTemplateInShelf", p)
}
@if(Model.ProductsList.TotalItemCount > Model.ItemsOnPage)
{
@:<div style="clear:both">
@:<div class="pull-left">@Html.PagedListPager(Model.ProductsList, x => Url.Action("YourShelf", "Product", new { categoryId = Model.CategoryId, pageNumber = x, itemsOnPage = Model.ItemsOnPage }))</div>
}
 <script src="@Url.Content("/Scripts/jquery.flip.js")" type="text/javascript"></script>